<template>
	<view class="classLayout pageBg">
		<custom-nav-bar #title>分类</custom-nav-bar>
		<view class="classift">
			<theme-item v-for="item in classIfy" :key="item._id" :item="item"></theme-item>
		</view>
	</view>
</template>

<script setup>
	import {
		ref
	} from 'vue';
	import {
		globalVariable
	} from '../All.js'; // 请求重复的变量
	var classIfy = ref([]); // 接收壁纸分类
	// 壁纸分类
	var getClassIfy = async () => {
		var res = await uni.request({
			url: globalVariable().url + 'classify',
			header: {
				"access-key": globalVariable().accessKey
			},
			data: {
				pageSize: 15
			}
		})
		// console.log(res);
		if (res.data.errCode === 0) {
			// 查询成功
			classIfy.value = res.data.data;
		}
	}
	getClassIfy();
</script>

<style lang="scss" scoped>
	.classift {
		padding: 30rpx;
		display: grid;
		gap: 15rpx;
		grid-template-columns: repeat(3, 1fr);
	}
</style>